<%@ page import="java.sql.Connection" %>
<%@ page import="java.sql.PreparedStatement" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="com.example.demo2.DBUtil" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Insert title here</title>
		<link rel="stylesheet" type="text/css" href="css/rest.css"/>
		<style type="text/css">
			body{width: 100%;height: 100%;}
			*{margin: 0;padding: 0;}
				.bjt{background:radial-gradient(#6f4351,#40325b);width: 100%;height: 120px;}
				.huixiang{width: 200px;height: 80px;position: absolute;left: 0px;top: 10px;}
				.ziti{font-size: 25px;font-style: italic;font-family: 宋体;color:#91b5ff ;font-weight: 600;position: absolute;left:180px;top: 44px;}
				li{float: left;font-size: 22px;padding: 10px;margin-left: 60px;color: aqua;}
				.liebiao{position: absolute;left: 300px;top: 35px;}
				.zixuankuang{font-size: 12px;color: gray;width: 210px;height:38px;position: absolute;left: 1100px;top: 38px;border-radius: 50px;}
				.sousuo{width: 40px;height: 38px;position: absolute;left: 1274px;top: 40px;border-radius: 50px;background-color: dimgray;}
				li>a{color: white;}
				.si{background-color: black;height: 300px;position: relative;top: 2000px;}
				.c1{font-size: 18px;font-weight: 300;color: white;position: absolute;left: 450px;top: 50px;}
				.c1-1{color: red;}
				.c2{font-size: 18px;font-weight: 300;position: absolute;left: 520px;top:80px;color: white;}
				.c3{font-size: 18px;font-weight: 300;color: white;position: absolute;left: 600px;top:120px;}
				.c4{height: 40px;width: 130px;position: absolute;left: 580px;top:180px;}
				.c5{height: 40px;width: 130px;position: absolute;left: 740px;top:180px;}
				.c6{height: 40px;width: 130px;position: absolute;left: 900px;top:180px;}
				.denglu>a{color: white;}
				.m{margin-left: 200px;margin-top: -150px;font-size: 30px;color: gray;}
				.m1-1{width: 400px;height: 500px;margin-left: 200px;margin-top: 60px;}
				.m2{font-size: 36px;font-weight: 600;position: absolute;left: 700px;top: 240px;}
				.m3{background-color: lightgray;width: 400px;height: 150px;position: absolute;left: 700px;top: 320px;}
				.m4{font-size: 55px;color: red;margin-top: 42px;margin-left: 20px;}
				.m5{font-size: 40px;position: absolute;left: 210px;top: 54px;text-decoration: line-through;color: darkgray;}
				.m6{font-size: 25px;position: absolute;left: 706px;top: 500px;}
				.m7{font-size: 25px;position: absolute;left: 706px;top: 550px;color:orange;}
				.m8{font-size: 55px;border-radius: 50px;width: 265px;height: 100px;
					margin-left: 740px;margin-top: -105px;display: flex;
					justify-content: center;
					align-items: center;
					align-content: center;}
				
		</style>
		<link rel="stylesheet" href="css/bootstrap.css">

	</head>
	<body>
		<div class="bjt">
			<div class="si">
				<div class="c1">关于悦享汇：<span class="c1-1">关于我们	| 管理团队 | 投资者关系 |</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;友情链接：<span class="c1-1">美团网 | 美团下载 | 欢喜首映 |</span></div>
				<div class="c2">QQ邮箱：2112633811.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;客服电话：152425125</div>
				<div class="c3">悦享汇用户服务协议 |			悦享汇平台交易规则总则 | 			隐私政策 |</div>
				<img src="img/C9.png"class="c4" >
				<img src="img/C8.png"class="c5" >
				<img src="img/C7.png"class="c6" >
				</div>
			<img src="img/R-C.png" class="huixiang">
			<div class="ziti">悦享汇电影</div>
			<div class="liebiao">
				<ul>
				<li><a href="shouye.jsp">首页</a></li>
				<li><a href="dianying.jsp">电影</a></li>
				<li><a href="yingyuan.jsp">影院</a></li>
				<li><a href="bangdan.jsp">榜单</a></li>
				<li><a href="redian.jsp">热点</a></li>
				<li><a href="shangcheng.jsp">商城</a></li>
			</ul>
			</div>
			<%@include file="sousuo.jsp"%>

			<%@include file="dl.jsp"%>



				<%
					String m_id = request.getParameter("id");
					String qiangou = request.getParameter("qg");
					Connection cn = null;
					PreparedStatement ps = null;

					ResultSet rs = null;
					String sql = "";
					cn = DBUtil.getConnection();
					sql = "select * from shangp where id = "+m_id;
					ps = cn.prepareStatement(sql);
					rs = ps.executeQuery();
					String name="";
					String img="";
					String qian="";
					String new_qian="";
					String fuw="";
					String shuom="";
					int id = 0;


					while(rs.next()){
						id = rs.getInt("id");
						name = rs.getString("name");
						img = rs.getString("img");
						qian = rs.getString("qian");
						new_qian = rs.getString("new_qian");
						fuw=rs.getString("fuw");
						shuom=rs.getString("shuom");

					}

					if (qiangou != null){
							int n=0;
							sql = "insert into qg_dd(u_id,s_id,qian) values(?,?,?)";
							ps = cn.prepareStatement(sql);

							ps.setObject(1, u_id);
							ps.setObject(2, m_id);
							ps.setObject(3, new_qian);
							System.out.println(u_id + " " +m_id+";"+new_qian);
							n= ps.executeUpdate();
							response.sendRedirect("qianggou.jsp?id=" + m_id);
					}
				%>
					<div class="m">	<a href="shouye.jsp">首页</a><a href="shangcheng.jsp"> >商城</a> ><%=name%></div>
								<div class="m1">
									<img src="<%=img%>"class="m1-1">
								</div>
				
							<div class="m2">
								<%=name%>
							</div>
		
		
					<div class="m3">		
					<div class="m4">￥<%=new_qian%></div>	<div class="m5">￥<%=qian%></div>
					
					</div>	
					
					<div class="m6">
						服务：<%=fuw%>
					</div>
					<div class="m7">
						说明：<%=shuom%>
					</div>
					
					
					<div class="m8">
						<button type="button" class="btn btn-danger  btn-lg"
								style="width: 80%;height: 80%;border-radius: 55px;"
								data-toggle="modal" data-target="#qgModal">立即抢购</button>
					</div>

			<div class="modal fade" id="qgModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
				<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
					<div class="modal-content">
						<div class="modal-header">
							<h5 class="modal-title" id="exampleModalLabel">扫码付款</h5>
							<button type="button" class="close" data-dismiss="modal" aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
						</div>


						<div class="modal-body">
							<div class="form-group">
								<img src="img/qrfk.png">
							</div>

						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
							<a href="qianggou.jsp?qg=1&id=<%=m_id%>" type="submit" class="btn btn-primary">确认</a>
						</div>
					</div>
				</div>
			</div>







	</body>
	<script src="js/jQuery.js"></script>
	<script src="js/bootstrap.js"></script>
</html>
